#ifndef _ROBOT_H
#define _ROBOT_H

#include <QtGui/QGraphicsPixmapItem>
#include <vector>
#include <string>


class Sensor ;
class Actuator ;
class MovingActuator ;
class RobotMap ;
class GPS ;

class Robot
{
private :
    std::string _name ;
    RobotMap* _map ;
    std::vector<Sensor*> _sensors ;
    std::vector<Actuator*> _actuators ;
    MovingActuator* _movingActuator ;
    QGraphicsPixmapItem* _image ;
	
	void updatesSensors() ;
public:
    Robot ( const std::string& name, RobotMap* map );
    Robot ( std::string name );
    ~Robot() ;

    QGraphicsPixmapItem* image() const ;
    Sensor* sensor ( int id ) const ;
    Actuator* actuator ( int id ) const ;
    const std::string& name() const ;
    int sensorsCount() const ;
    int actuatorsCount() const ;
	
	int sensorValue(int sens, int value) const ;
	void doActuatorAction(int actu) ;

    void moveUp() ;
    void moveDown() ;
    void moveLeft() ;
    void moveRight() ;

    void updateImagePosition() ;
    void setImage ( const std::string& fileName ) ;
    void setImage ( const QPixmap& pm ) ;
    void setRobotImageZValue(int zvalue) ;
    void setRobotMap ( RobotMap* robotmap ) ;

    int addSensor ( Sensor* sensor ) ;
    int addActuator ( Actuator* actuator ) ;
} ;

// #include <python2.7/Python.h>
// #include <boost/python.hpp>
// #include <boost/python/copy_const_reference.hpp>
// #include <boost/python/manage_new_object.hpp>
// 
// BOOST_PYTHON_MODULE(librobot)
// {
// 	boost::python::class_<Robot>("Robot", boost::python::init<std::string>())
// 		.def("name", &Robot::name, boost::python::return_value_policy<boost::python::copy_const_reference>())
// 		.def("sensorsCount", &Robot::sensorsCount)
// 		.def("actuatorsCount", &Robot::actuatorsCount)
// 		
// 		.def("sensorValue", &Robot::sensorValue)
// 		.def("doActuatorAction", &Robot::doActuatorAction)
// 		
// 		.def("moveUp", &Robot::moveUp)
// 		.def("moveDown", &Robot::moveDown)
// 		.def("moveLeft", &Robot::moveLeft)
// 		.def("moveRight", &Robot::moveRight)
// 	;
// }



#endif // _ROBOT_H
